<?php
$_GET['goodsname'] = empty($_GET['goodsname']) ? '' : trim($_GET['goodsname']);
$_GET['userid'] = $__userinfo['userid'];

$oFavorite = new Favorite();
$favorite_list = $oFavorite->get_list('*', $_GET, array('id' => 'DESC'), $__page, $__pagesize);
if(!empty($favorite_list)){
	foreach($favorite_list['list'] as $key => $row){
		$row['trends']['stars'] = $row['trends']['score'] * 150 / 5;
		$row['addtime'] = ftime($row['addtime']);
		if(empty($row['goodsinfo']['filename'])){
			$row['goodsinfo']['url'] = PUB_DIR.'goods/'.time_to_path($row['goodsinfo']['addtime']).'/'.$row['goodsinfo']['id'].'.html';
		}else{
			$row['goodsinfo']['url'] = PUB_DIR.'goods/'.$row['goodsinfo']['filename'].'.html';
		}

		// 高亮关键词
		//if(!empty($_GET['goodsname'])){
			$row['_hl_goodsname'] = highlight_word($row['goodsname'], $_GET['goodsname']);
		//} 
		
		$favorite_list['list'][$key] = $row;
	}
	$vars['list'] = $favorite_list['list'];
	$vars['pagelist'] = $favorite_list['pagelist'];
}
//print_r($favorite_list);
?>